<?php
class EventManager_Form_User_Base extends SF_Form_Abstract
{
    public function init(){

    $this->addElementPrefixPath(
     'EventManager_Validate',
      APPLICATION_PATH . '/modules/eventManager/models/validate',
      'validate'
    );
    $this->addPrefixPath(
    'EventManager_Form_Element',
    APPLICATION_PATH.'/modules/eventManager/forms/element',
    'element'
    );
    $this->getView()->addScriptPath(APPLICATION_PATH.'/modules/eventManager/forms/element');
		
     $this->addElement('select','usr_prefix',array(
     'required' 		=>true,
     'label'			=>'Title',
     'multiOptions'	=> array('Dhr'=>'Dhr', 'Mevrouw'=>'Mevrouw')
    ));
			
    $this->addElement('text','usr_firstname', array(
     'filters'	=> array('StringTrim'),
     'validators'	=> array(
      'Alpha',
       array('StringLength',true,array(3,128))
      ),
      'required'	=>	true,
      'label'		=> 'Firstname',
      'attribs'	=>	array("class"	=>	"capitalize")
    ));
			
    $this->addElement('text','usr_surname', array(
     'validators'	=> array(
     'Alpha',
      array('StringLength',true,array(3,128))
     ),
     'required'	=>	true,
     'label'		=> 'Lastname',
     'filters'	=> array('StringTrim')
    ));

    //usr_street
    $this->addElement('text','usr_street', array(
    
     'label'			=>	'Straat'
    ));
    //usr_homeno
    $this->addElement('text','usr_homeno', array(
     'filters'		=>	array(),
     'validators'	=>	array(),
     'label'		=>	'Huisnummer'
    ));
    //usr_postcode
    $this->addElement('text','usr_postcode', array(
     'filters'		=>	array(),
     'validators'	=>	array(
     'Alpha',
      array('StringLength',true,array(3,15))
     ),
    'label'             =>	'Postcode'
    ));

    //usr_place
    $this->addElement('text','usr_place', array(
     'filters'		=>	array(),
     'validators'	=>	array(),
     'label'			=>	'Woonplaats'
    ));
		
    $this->addElement('text','usr_email', array(
     'filters'	=> array('StringTrim', 'StringToLower'),
     'validators'	=> array(
      array('StringLength',true,array(3,128)),
      array('EmailAddress'),
      array('UniqueEmail', false, array(new EventManager_Model_User())),
     ),
     'required'	=>	true,
     'label'		=> 'Email',
    ));
    //password
    $this->addElement('password','usr_password',array(
     'filters'		=>	array('StringTrim'),
     'validators'	=> 	array(
      array('StringLength',true, array(6,128))
     ),
     'required'	=>true,
     'label'		=>'Wachtwoord'
    ));
    //password verification
    $this->addElement('password','passwdVerify',array(
     'filters'		=>	array('StringTrim'),
     'validators'	=> 	array(
      'PasswordVerification'
     ),
     'required'	=>true,
     'label'		=>'Bevestig Wachtwoord'
    ));
    //Phone number
    $this->addElement('text','usr_phone',array(
     'filters'		=>	array(),
     'validators'	=>  array(),
     'label'			=>	'Telefoonnummer'
    ));
    //Mobile number
    $this->addElement('text','usr_mobile', array(
     'filters'		=>	array(),
     'validators'	=>	array(),
     'label'			=>	'Mobiel'
    ));
    $this->addElement('date', 'usr_birthdate', array(
     'filters' => array('StringTrim', 'StringToLower'),
     'validators' => array(
     array('StringLength', true, array(3, 128)),
            ),
            'required' => true,
            'label' => 'Geboortedatum',
        ));

    /*
    $this->addElement('text','usr_birthdate', array(
     'label'			=>	'Geboortedatum',
     'validators'	=>	array(new Zend_Validate_Date('DD-MM-YYYY')),
     'attribs'		=>	array('size'=> 20)
    ));
     */
     
			// usr_nrkaRegistration
			$this->addElement('text','usr_nrkaRegistration', array(
				'filters'		=>	array(),
				'validators'	=>	array(),
				'label'			=>	'Regsitratiecode Rode Kruis'
			
			));
			// usr_certifcateExpire
			$this->addElement('text','usr_certifcateExpire', array(
				'filters'		=>	array(),
				'validators'	=>	array(),
				'label'			=>	'Verloopdatum EHBO diploma'
			
			));
			
			$this->addElement('file', 'usr_photo', array(
				'label'			=>	'Foto',
				'destination'	=>	'/var/www/nrka2/uploads',
				'validators'	=>	array(
					'count'			=>	array(false,1),
					'size'			=>	array(false,102400),
					'extension'		=>	array(false,'jpg,png,gif')	
				),
				'attribs'		=> array('ecntype'	=>'multipart/form-data')
			));
			
			
			
			$this->addElement('select','rgh_id',array(
			'required' 		=>	true,
			'label'			=>	'Rechten'			
			));
			
			
			$this->addElement('submit','submit', array(
			'required'	=>false,
			'ignore'	=>true,
			'decorators'=> array('ViewHelper',array('HtmlTag',array('tag' => 'dd','id' =>'form-submit')))
			));
			$this->addElement('hidden','usr_id', array(
			'filters'	=>	array('StringTrim'),
			'required'	=>	true,
			'decorators'=>	array('ViewHelper',array('HtmlTag',array('tag' => 'dd','id' =>'form-submit')))
			));
	}

}